﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MessageControl.ascx.cs"
    Inherits="CARMS.Controls.MessageControl" %>
<%@ Import Namespace="CARMSBusiness.InterFace" %>
<table cellpadding="5" cellspacing="0" border="0" width="100%">
    <tr>
        <td>
            <asp:Label ID="Label1" runat="server" SkinID="LabelTitle" Text="Latest 5 Personal Message"></asp:Label>
        </td>
        <td align="right">
            <asp:HyperLink runat="server" SkinID="LinkBold" Text="View All Message(s)"  NavigateUrl="~/Message/MessageList.aspx"></asp:HyperLink>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <vs:GridView ID="gridList" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                OnRowDataBound="gridList_RowDataBound" OnRowCommand="gridList_OnRowCommand">
                <Columns>
                    <vs:TemplateField HeaderText="Report ID" ItemStyle-Width="150px" SortExpression="RegistrationNumber">
                        <ItemTemplate>
                            <div style="width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
                                title="<%# Eval("G1001")%>">
                                <%# Eval("G1001")%>
                            </div>
                        </ItemTemplate>
                    </vs:TemplateField>
                    <vs:TemplateField HeaderText="Subject" ItemStyle-Width="160px">
                        <ItemTemplate>
                            <div style="width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
                                title='<%#Eval("G10010")%>'>
                         <%#Eval("G10010")%>
                            </div>
                        </ItemTemplate>
                    </vs:TemplateField>
                    <vs:TemplateField HeaderText="Create Date" ItemStyle-Width="130px">
                        <ItemTemplate>
                            <div style="width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
                                title='<%#((DateTime)Eval("CreateDate")).ToString(ApplicationConfiguration.DateTimeFormat)%>'>
                                <%#((DateTime)Eval("CreateDate")).ToString(ApplicationConfiguration.DateTimeFormat)%>
                            </div>
                        </ItemTemplate>
                    </vs:TemplateField>
                    <vs:TemplateField HeaderText="Operation" ItemStyle-Width="120px">
                        <ItemTemplate>
                            <asp:HyperLink runat="server" ID="linkPickUp" Text="Pick Up" CommandName="PickUp"
                                CommandArgument='<%#Eval("GID") %>' />
                         </ItemTemplate>
                    </vs:TemplateField>
                </Columns>
            </vs:GridView>
        </td>
    </tr>
</table>
